package com.cyy.dyeing.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cyy.dyeing.dto.GroupDto;
import com.cyy.dyeing.model.Group;
import com.cyy.dyeing.model.Plan;
import com.cyy.dyeing.dto.PlanDto;
import com.cyy.dyeing.mapper.ProcessMapper;
import com.cyy.dyeing.service.ProcessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @Author: cyy
 * @Date: 2024/7/27
 */
@Service
public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Group> implements ProcessService {

    @Autowired
    private ProcessMapper processMapper;

    private SimpleDateFormat groupIdFmt = new SimpleDateFormat("yyyyMMdd-HHmmss-SSS");
    private AtomicInteger no = new AtomicInteger(0);

    @Override
    public List<Plan> findPlanList(PlanDto planDto) {
        return processMapper.findPlanList(planDto);
    }

    @Override
    public List<Group> findGroupList(GroupDto groupDto) {
        return processMapper.findGroupList(groupDto);
    }

    @Override
    public void updateGroupNumOfGroup(String groupId, String pretreatNum, Integer retreatNum) {
        processMapper.updateGroupNumOfGroup(groupId, pretreatNum, retreatNum);
    }


}
